package com.yyw.gulimall.product.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.*;
import org.hibernate.validator.constraints.Range;
import org.hibernate.validator.constraints.URL;

import javax.validation.constraints.Digits;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * 品牌
 *
 * @author yiyw
 * @date 2020-10-24 11:59:19
 */
@Data
@TableName("pms_brand")
@AllArgsConstructor
@NoArgsConstructor
@Builder
@EqualsAndHashCode
public class BrandEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 品牌id
     */
    @TableId
    private Long brandId;
    /**
     * 品牌名
     */
    @NotBlank(message = "品牌名不能为空")
    private String name;
    /**
     * 品牌logo地址
     */
    @URL(message = "请输入正确的logo地址")
    private String logo;
    /**
     * 介绍
     */
    private String descript;
    /**
     * 显示状态[0-不显示；1-显示]
     */
    @NotNull(message = "请输入是否显示")
    @Digits(integer = 1, fraction = 0, message = "数字长度大小超出限制")
    @Range(min = 0, max = 1, message = "显示状态只能是0-1")
    private Integer showStatus;
    /**
     * 检索首字母
     */
    @NotBlank(message = "首字母不能为空")
    @Pattern(regexp = "^[a-zA-Z]$", message = "首字母范围为:a-z或A-Z")
    private String firstLetter;
    /**
     * 排序
     */
    private Integer sort = 0;

}
